Skip to content

Fix Korean IME space handling on Windows#3339

Open
kevin0181 wants to merge 1 commit into
wavetermdev:mainfrom
kevin0181:fix/windows-korean-ime-space
Open

Fix Korean IME space handling on Windows#3339
kevin0181 wants to merge 1 commit into
wavetermdev:mainfrom
kevin0181:fix/windows-korean-ime-space

Conversation

@kevin0181
Copy link
Copy Markdown

@kevin0181 kevin0181 commented May 28, 2026

Summary

Fixes a Windows-specific Korean IME composition bug in the terminal input handler.

When using the Korean IME on Windows, pressing Space while a syllable is still composing can be handled by Wave's terminal keydown path before Chromium finishes committing the composed text. In that case, the terminal can receive the Space before the final Korean
syllable, producing the wrong commit order.

This PR adds a narrow guard for that case and lets the native IME composition flow finish handling the plain Space key.

Fixes #3335

Problem

Reproduction case:

  1. Run Wave on Windows with the Korean IME enabled.
  2. Focus a terminal block.
  3. Type Korean text where the final syllable is still under IME composition.
  4. Press Space to commit the syllable and insert a word separator.

Before this change, the Space key could be processed by the terminal keydown handler before the IME composition committed the final syllable. This caused incorrect ordering in the terminal input.

Approach

The change adds an early check in handleTerminalKeydown for the specific IME case:

  • platform is Windows
  • the key event is currently composing
  • the key is plain Space
  • Ctrl/Alt/Meta are not pressed

When all of those are true, the handler returns early so Chromium/native IME composition can commit the text in the correct order.

The guard is intentionally narrow so normal terminal key handling, shortcuts, and non-IME Space input continue to use the existing path.

Scope

This PR changes only frontend/app/view/term/term-model.ts.

It does not include unrelated cleanup, formatting churn, refactors, or broader terminal input behavior changes.

Validation

Tested locally on Windows 11 with the Korean IME enabled.

Verified:

  • Wave builds and launches locally.
  • task dev builds the backend/frontend and starts Electron.
  • After clearing dev data, task electron:winquickdev launches correctly on Windows.
  • Korean IME composition commits the final syllable before inserting Space.
  • Plain Space still works normally outside active IME composition.
  • Ctrl/Alt/Meta + Space behavior is not affected by this guard.

Also ran:

  • npm exec eslint -- frontend/app/view/term/term-model.ts
  • npm exec prettier -- --check frontend/app/view/term/term-model.ts
  • npm exec tsc -- --noEmit

tsc --noEmit currently fails on existing preview mock type errors unrelated to this change.

Issue

When typing Korean text with the Windows Korean IME, punctuation can be inserted before the final composed syllable is committed.

For example, when I type:

안녕하세요?

Wave inputs it as:

안녕하세?요

The expected behavior is that the composed Korean text should be committed in the correct order before the punctuation is inserted.

I attached a video below showing the issue.

Desktop.2026.05.29.-.01.53.51.03.mp4

@CLAassistant
Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 28, 2026

Review Change Stack

Walkthrough

This PR adds IME (Input Method Editor) handling to the terminal keydown event handler. A new guard at the start of handleTerminalKeydown checks whether a space keydown should be deferred using a new helper method shouldDeferImeSpaceToComposition. This method detects a Windows Korean IME edge case where space during composition would be processed prematurely. When the condition is detected, the handler returns early without further key processing.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and specifically describes the main change: fixing Korean IME space handling on Windows.
Linked Issues check ✅ Passed The code changes address the issue by deferring space keydown handling to native IME composition, which preserves the Korean IME commit order as required by #3335.
Out of Scope Changes check ✅ Passed All changes are directly related to fixing the Korean IME space handling issue on Windows, with no out-of-scope modifications detected.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Description check ✅ Passed The pull request description is well-related to the changeset, providing clear context about the Windows Korean IME space handling bug fix in the terminal input handler.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 28, 2026

Actionable comments posted: 0

Copy link
Copy Markdown
Author

Confirmed this PR works on Windows 11.

I built and ran the app locally with task dev, then reset the dev data and verified it launches correctly with task electron:winquickdev. The Windows Korean IME space handling behaves as expected.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Korean keyboard input issue

3 participants